package com.edu.hre.struts.form.survey;

import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.struts.action.ActionForm;
import com.edu.hre.common.utils.CommonUtils;

public class SurveySummaryDetailForm extends ActionForm  {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6996477842247655445L;
	
	private int id;
	private String topic = "";
	private String subunit = "";
	private Date startDate = null;
	private Date endDate = null;
	private String lastModifiedUser = "";
	private boolean finished;
	private String html;
	
	
	public SurveySummaryDetailForm() {
		// TODO Auto-generated constructor stub
	}


	public SurveySummaryDetailForm(int id, String topic, String subunit, 
			Date startDate, Date endDate, String lastModifiedUser, boolean finished) {
		super();
		this.id = id;
		this.topic = topic;
		this.subunit = subunit;
		this.startDate = startDate;
		this.endDate = endDate;
		this.lastModifiedUser = lastModifiedUser;
		this.finished = finished;
	}


	public String getTopic() {
		return topic;
	}


	public void setTopic(String topic) {
		this.topic = topic;
	}


	public String getSubunit() {
		return subunit;
	}


	public void setSubunit(String subunit) {
		this.subunit = subunit;
	}


	public Date getStartDate() {
		return startDate;
	}


	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}


	public Date getEndDate() {
		return endDate;
	}


	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}


	public String getLastModifiedUser() {
		return lastModifiedUser;
	}


	public void setLastModifiedUser(String lastModifiedUser) {
		this.lastModifiedUser = lastModifiedUser;
	}


	public boolean getFinished() {
		return finished;
	}


	public void setFinished(boolean finished) {
		this.finished = finished;
	}
	
	private static final SimpleDateFormat dateFormat2 = new SimpleDateFormat("MM/dd/yyyy");
	public String getStartDateStr() {
		try {
			return dateFormat2.format(startDate);
		} catch (Exception e) {
			return "";
		}
	}

	public void setStartDateStr(String startDate) {
		try {
			this.startDate = dateFormat2.parse(startDate);
		} catch (Exception e) {
			CommonUtils.println(e.getMessage());
		}
	}

	public String getEndDateStr() {
		try {
			return dateFormat2.format(endDate);
		} catch (Exception e) {
			CommonUtils.println(e.getMessage());
			return "";
		}
	}

	public void setEndDateStr(String endDate) {
		try {
			this.endDate = dateFormat2.parse(endDate);
		} catch (Exception e) {
			CommonUtils.println(e.getMessage());
		}
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}


	public String getHtml() {
		return html;
	}


	public void setHtml(String html) {
		this.html = html;
	}
	
}
